#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.resource;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;

import ${package}.dto.EchoDTO;
import ${package}.model.Echo;
import ${package}.service.EchoService;

@Path("/echo")
public class EchoResource {

	private EchoService echoService;

	public EchoResource(EchoService echoService) {
		super();
		this.echoService = echoService;
	}

	public EchoResource() {
		this(new EchoService());
	}

	@GET
	@Path("/echo/{mee}")
	@Produces("application/json")
	public EchoDTO echo(@PathParam("mee") String message) {
		Echo echo = this.echoService.echo(message);
		return this.getEntityToDTO(echo);
	}

	private EchoDTO getEntityToDTO(Echo echo) {
		EchoDTO echoDTO = new EchoDTO(echo.getId(), echo.getMessage());
		return echoDTO;
	}

}

